#pragma once

/**
 *  Module Name: 	AESDefs.h
 *  
 *  Module defines constants and types used by the AES module. 
 * 
 * @author Ravi Mohandas, Mar 06 2011
 */

#include "SecrecySystem.h"

	/**
	 * Error constants 
	 * 
	 */

	#define E_SUCCESS			 0
	#define E_FAILURE			-1
	#define E_INVALID_PARAMS	-2
	#define E_NO_MEMORY			-3
	#define E_INVALID_STATE		-4


	/**
	 * Some Other constants 
	 * 
	 */

	#define	SIZE_256	32
	#define SAFE_FREE(x) {if (x){ free(x); x = NULL;}}

	/**
	 * size of key material provided as seed
	 * 
	 */
	typedef enum KeySize { System_key128, System_key192, System_key256 };
	
	
	/***
	 * holds the configuration of the params for AES transforms.
	 *
	 */

	typedef struct AESConfiguration
	{
		int		_nDataBlks;			// number of 4-byte sized words of data to process at a time 
		int		_nKeyBlks;			// number of 4-byte sized words of key material to use 
		int		_nRoundsTransforms;	// stores the number of rounds the secrecy transformations are applied!

	} AESConfiguration;

	/***
	 * holds the higher level abstraction represented by the secrecy system.
	 *
	 */

	typedef struct SecrecySystem
	{
		SecrecyLevel _secrecyLevel;
		byte		 _keyRef [SIZE_256];
		int			 _keyLength;

	}SecrecySystem;
